home *** CD-ROM | disk | FTP | other *** search
- /*
- File: SBP2DemoApp.h
-
- Contains: Definitions for SBP-2 demo application.
-
- Version: 1.0
-
- Copyright: © 1998-1999 by Apple Computer, Inc., all rights reserved.
-
- File Ownership:
-
- DRI: Eric Anderson
-
- Other Contact:
-
- Technology: FireWire
-
- Writers:
-
- (EA) Eric Anderson (ewa)
-
- Change History (most recent first):
-
- <FW6> 1/10/99 EA Added support for testing cable power management API.
- <FW5> 12/31/98 EA Added support for Query Logins.
- <FW4> 12/31/98 EA Added support for sending a TARGET RESET management ORB.
- <FW3> 11/18/98 EA Added LUN to our global data.
- <FW2> 9/20/98 EA Filled in header comments.
- <FW1> 9/20/98 EA first checked in
- */
-
-
- #ifndef __SBP2DEMOAPP__
- #define __SBP2DEMOAPP__
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- #if PRAGMA_IMPORT_SUPPORTED
- #pragma import on
- #endif
-
- #if PRAGMA_ALIGN_SUPPORTED
- #pragma options align=mac68k
- #endif
-
- // These are for positioning the dialogs.
-
- #define kDITop 0x0050
- #define kDILeft 0x0070
-
- // kExtremeNeg and kExtremePos are used to set up wide open rectangles and
- // regions.
-
- #define kExtremeNeg (-32768)
- #define kExtremePos (32767 - 1) // Required to address an old region bug
-
- enum
- {
- kInvalidWindowRef = 0
- };
-
- enum
- {
- kMenuBarResourceID = 128,
-
- kSBP2DemoWindowResourceID = 128,
-
- kAboutAlertResourceID = 128
- };
-
- enum
- {
- kAppleMenuID = 128,
- kAboutAppleMenuItem = 1,
-
- kFileMenuID = 129,
- kNewFileMenuItem = 1,
- kCloseFileMenuItem = 4,
- kQuitFileMenuItem = 12,
-
- kEditMenuID = 130,
- kUndoEditMenuItem = 1,
- kCutEditMenuItem = 3,
- kCopyEditMenuItem = 4,
- kPasteEditMenuItem = 5,
- kClearEditMenuItem = 6,
-
- kCommandMenuID = 131,
- kLoginMenuItem = 1,
- kLogoutMenuItem = 2,
- kQueryLoginsMenuItem = 4,
- kStatusInquiryMenuItem = 6,
- kModeSenseMenuItem = 7,
- kReadBlockMenuItem = 8,
- kTargetResetMenuItem = 9,
- kPowerTestMenuItem = 10
- };
-
- struct SBP2DemoAppDataStruct
- {
- QDGlobals qdGlobals; // Quickdraw globals for our application.
-
- struct SBP2DemoDataStruct
- *sbp2DemoDataList; // List of devices.
-
- AEEventHandlerUPP openApplicationEventHandler; // Handler for open application events.
- Boolean openApplicationEventHandlerInstalled; // True if handler was successfully installed.
-
- AEEventHandlerUPP openDocumentsEventHandler; // Handler for open documents events.
- Boolean openDocumentsEventHandlerInstalled; // True if handler was successfully installed.
-
- AEEventHandlerUPP printDocumentsEventHandler; // Handler for print documents events.
- Boolean printDocumentsEventHandlerInstalled; // True if handler was successfully installed.
-
- AEEventHandlerUPP quitApplicationEventHandler; // Handler for quit application events.
- Boolean quitApplicationEventHandlerInstalled; // True if handler was successfully installed.
-
- AEEventHandlerUPP deviceAddedEventHandler; // Handler for device added events.
- Boolean deviceAddedEventHandlerInstalled; // True if handler was successfully installed.
-
- AEEventHandlerUPP deviceRemovedEventHandler; // Handler for device removed events.
- Boolean deviceRemovedEventHandlerInstalled; // True if handler was successfully installed.
-
- SBPClientID sbpClientID; // Our client ID for the sample driver family.
-
- Boolean inForeground; // True if app is in foreground.
- Boolean quit; // Flag to tell event loop to quit.
- };
- typedef struct SBP2DemoAppDataStruct
- SBP2DemoAppData,
- *SBP2DemoAppDataPtr;
-
- struct SBP2DemoDataStruct
- {
- struct SBP2DemoDataStruct
- *pNextSBP2DemoData; // Link to next data record.
- WindowRef sbp2DemoWindowRef; // Window reference for this device.
- SBPDriverID sbpDriverID; // Reference to driver we control.
- Boolean login; // True if logged in.
- Boolean reconnecting;
- Boolean reconnectFailed;
- UInt32 lastCommand;
- UInt32 lastError;
- SBPQueryLoginsParams sbpQueryLoginsParams;
- SBPStatusInquiryParams sbpStatusInquiryParams;
- SBPModeSenseParams sbpModeSenseParams;
- SBPReadBlockParams sbpReadBlockParams;
- SBPTargetResetParams sbpTargetResetParams;
- SBPPowerTestParams sbpPowerTestParams;
- UInt32 notificationCounter;
- UInt32 notificationEvent;
- UInt32 notificationLength;
- Ptr notificationMessage;
- UInt32 lun;
- };
- typedef struct SBP2DemoDataStruct
- SBP2DemoData,
- *SBP2DemoDataPtr;
-
- #if PRAGMA_ALIGN_SUPPORTED
- #pragma options align=reset
- #endif
-
- #if PRAGMA_IMPORT_SUPPORTED
- #pragma import off
- #endif
-
- #ifdef __cplusplus
- }
- #endif
-
- #endif /* __SBP2DEMOAPP__ */
-